package csc.daonjpa.java.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

@Entity(name = "card")
public class Card implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "accountNumber")
	private String accountNumber;
	
	@Column(name = "accountAmount")
	private int accountAmount;
	
	@Column(name = "cardType")
	private String cardType;
	
	@OneToOne
	@JoinColumn(name = "accountNumber")
	private Account account;

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	public String getAccountNumber() {
		return accountNumber;
	}

	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}

	public int getAccountAmount() {
		return accountAmount;
	}

	public void setAccountAmount(int accountAmount) {
		this.accountAmount = accountAmount;
	}

	public String getCardType() {
		return cardType;
	}

	public void setCardType(String cardType) {
		this.cardType = cardType;
	}

	public Card(String accountNumber, int accountAmount,
			String cardType, Account account) {
		super();
		this.accountNumber = accountNumber;
		this.accountAmount = accountAmount;
		this.cardType = cardType;
		this.account = account;
	}
	
	public Card(){ }
}
